/*
struct
https://www.bilibili.com/video/BV1gf4y1r79E/?p=17&spm_id_from=pageDriver&vd_source=8bd7b24b38e3e12c558d839b352b32f4
*/
package main

import "fmt"

type myint int // 声明int的一个别名

type Book struct {
	title string
	auth  string
}

// 传值
func printStruct(book Book) {
	fmt.Printf("%v\n", book)
}

func changeStruct(book *Book) {
	book.auth = "666"
}

func main() {
	fmt.Println("struct")

	// type
	var a myint = 10
	fmt.Println(a)

	// type
	var book1 Book
	book1.title = "Golang"
	book1.auth = "zhangsan"
	fmt.Println(book1)
	fmt.Printf("book1 = %v\n", book1)
	printStruct(book1)
	changeStruct(&book1)
	printStruct(book1)
}
